package com.bestseller.contain;

import org.apache.commons.lang.xwork.StringUtils;

public class ServicePoint {
	private static ServicePointCode spc;
	static{
		spc=new ServicePointCode();
	    spc.load("applicationContext.xml");
	}
	
	public static Object getService(String beanname){
		if(StringUtils.isBlank(beanname)){
			throw new RuntimeException("访问的服务名称不存在！");
		}
		Object bean=null;
		if(spc.ac.containsBean(beanname)){
			bean=spc.ac.getBean(beanname);
		}
		if(bean==null){
			throw new RuntimeException("访问的服务名称["+beanname+"]不存在!");
		}
		return bean;
	}
}
